<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件的注册</title>
</head>
<body>
    <div id="app">
        <com1></com1>
        <com2></com2>
    </div>

    <div id="app2">
        <com1></com1>
        <com2></com2>
    </div>

    <template id="temp1">
        <div>
            <h3>标题3</h3>
            <p>000000</p>
        </div>
    </template>
</body>
<script src='../../vue文件/vue.js'></script>
<script>
   

    let vm = new Vue({
        el: '#app',
        data: {
             msg:'hello vue.js'
        },
        methods: {},
        filters:{},
        computed: {},
        components:{
            com1:{
                template:'<h1>局部注册</h1>'
            },
            
            com2:{
                template:'#temp1'
            }

        }
    })

    let vm2 = new Vue({
        el: '#app2',
        data: {
             msg:'hello vue.js'
        },
        methods: {}
    })
</script>

</html>